package cn.edu.ctbu.bootstraptablepage.aspect;

import cn.edu.ctbu.bootstraptablepage.restcontroller.R;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class ExceptionHandle {

    @ExceptionHandler(value = Exception.class)
    public R handele(Exception e){
        return R.error(-1,e.getMessage());
    }
}
